package net.lab1024.smartadmin.module.weapp.orders.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import net.lab1024.smartadmin.module.weapp.orders.domain.dto.OrdersQueryDTO;
import net.lab1024.smartadmin.module.weapp.orders.domain.entity.OrdersEntity;
import net.lab1024.smartadmin.module.weapp.orders.domain.entity.OrdersReadLogEntity;
import net.lab1024.smartadmin.module.weapp.orders.domain.vo.OrdersVO;
import net.lab1024.smartadmin.module.weapp.orders.domain.vo.OrdersExcelVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * [  ]
 *
 * @author wuqian
 * @version 1.0
 * @company 五千
 * @copyright (c)  五千Inc. All rights reserved.
 * @date 2021-03-10 15:12:30
 * @since JDK1.8
 */
@Mapper
@Component
public interface OrdersDao extends BaseMapper<OrdersEntity> {

    /**
     * 获取超时未处理工单
     * @param statue 超时状态
     * @param outTime 超时时间
     * @return
     */
    List<OrdersVO> getOutTime(@Param("statue") Integer statue,@Param("outTime") Long outTime);
    /**
     * 分页查询
     * @param queryDTO
     * @return OrdersVO
    */
    IPage<OrdersVO> queryByPage(Page page, @Param("queryDTO") OrdersQueryDTO queryDTO);


    Integer selectCountById(@Param("uid") Long uid);
    /**
     * 添加查看记录
     * @param ordersReadLogEntity
     * @return
     */
    void addReadLog(OrdersReadLogEntity ordersReadLogEntity);

    void insertAndGetId(OrdersEntity ordersEntity);
    /**
     * 根据id删除
     * @param id
     * @return
    */
    void deleteById(@Param("id") Long id);

    /**
     * 根据id批量删除
     * @param idList
     * @return
    */
    void deleteByIdList(@Param("idList") List<Long> idList);

        /**
     * 查询所有导出数据
     * @param queryDTO
     * @return
     */
    List<OrdersExcelVO> queryAllExportData(@Param("queryDTO") OrdersQueryDTO queryDTO);

        /**
         * 查询批量导出数据
         * @param idList
         * @return
         */
    List<OrdersExcelVO> queryBatchExportData(@Param("idList") List<Long> idList);
}
